Component({
    properties: {
        val: String,
        showClear: Boolean,
        focus: Boolean,
        placeholder: String,
        confirmType: {
            type: String,
            value: "done"
        },
        type: String
    },
    data: {},
    methods: {
        inputHandler: function(t) {
            var e = t.detail.value;
            return e = e.trimLeft(), this.setData({
                showClear: !!e
            }), this.triggerEvent("input", {
                value: e
            }), {
                value: e
            };
        },
        focusHandler: function(t) {
            var e = t.detail.value;
            this.setData({
                showClear: !!e
            }), this.triggerEvent("focus");
        },
        blurHandler: function() {
            this.setData({
                showClear: !1
            }), this.triggerEvent("blur");
        },
        confirmHandler: function(t) {
            var e = t.detail.value;
            this.triggerEvent("confirm", {
                value: e
            });
        },
        clearHandler: function() {
            this.setData({
                val: "",
                showClear: !1,
                focus: !0
            }), this.triggerEvent("clear");
        }
    }
});